{include file="header"}
<div class="layui-container login">
    <div class="layui-row ">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">登录系统</div>
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">身份证号</label>
                            <div class="layui-input-block">
                                <input type="text" name="sfzh" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input type="text" name="password" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <button type="button" lay-submit lay-filter="add" class="layui-btn layui-btn-fluid">登  录</button>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
<script>
    layui.use('element', function(){



    });

    var multiple_images = [];
    layui.use(['upload', 'layer','laydate','form'], function () {
        var $ = layui.jquery
        var form = layui.form;
        var layer = layui.layer;
        //AJAX
        form.render();
        form.on('submit(add)', function(data){
            $.ajax({
                data:data.field,
                url:"{:url('dologin')}",    //请求的url地址
                dataType:"json",   //返回格式为json
                async:true,//请求是否异步，默认为异步，这也是ajax重要特性
                type:"POST",   //请求方式
                beforeSend:function(){
                    this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] });
                },
                success:function(data){
                    if(data.status==1){
                        layer.msg(data.msg, {
                            icon: 6,//成功的表情
                            time: 1000 //1秒关闭（如果不配置，默认是3秒）
                        }, function(){
                            setTimeout('location.href="ucenter/index"',1000);
                        });
                    }else{
                        layer.msg(data.msg)
                    }
                },
                complete:function(){
                    setTimeout('location.href="ucenter/index"',1000);
                    layer.close(this.layerIndex);

                },
                error:function(){
                    //请求出错处理
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });





</script>
{include file="footer"}